package engine.newUi
{
	import engine.data.BindManage;
	import engine.data.ModelLocator;
	import engine.data.Record;
	import engine.data.View;
	import engine.flag.ResourcesPath;
	import engine.logic.MenuListManager;
	import engine.logic.event.LogicEvent;
	import engine.net.datatype.WString;
	import engine.net.event.CustomMsgEvent;
	import engine.net.messages.CustomToClientFlag;
	import engine.net.messages.CustomToServerFlag;
	import engine.net.mgr.SystemSender;
	import engine.scene.SceneManager;
	import engine.tip.TipsMainLogic;
	import engine.ui.AlertUI;
	
	import flash.display.MovieClip;
	import flash.display.SimpleButton;
	import flash.events.MouseEvent;
	import flash.events.TimerEvent;
	import flash.utils.Timer;
	
	import newx.com.ResManager;
	import newx.com.config.StaticIni;
	import newx.com.control.NxClip;
	import newx.com.control.text.NxLabel;
	import newx.com.control.window.NxWindowEvent;
	import newx.utils.FilterUtil;

	/**
	 *神秘商店 
	 * @author liuel
	 * 
	 */	
	public class MysterySellLogic
	{
		/**
		 * 0,
		 * 1,白
		 * 2.绿
		 * 3.蓝
		 * 4.紫红
		 * 5.橙黄
		 * 6.黄
		 * 7.浅黄
		 */		
		protected const COLOR_TABLE	:Array	=	["","#ffffff'>","#1eff00'>","#20BFF8'>","#a335ee'>","#E8912E'>","#e5cc80'>","#ffff00'>"];
		private static var _self:MysterySellLogic;
		private var _ui:MysterySellUI;
		private var _model:ModelLocator;
		private var _grouplenth:int;
		private var _img:NxClip;
		private var _itemMC:MovieClip;
		private var _time:Timer;
		private var _date:Date;
		private var _txtCount:NxLabel;
		private var _strArr:Vector.<strInfo>;
		private var 		_ItemBack     :int      = -1;
		private var _bindManage:BindManage;
		
		private var _blindFlag:int = -1;
		private const MYSTERSELL_TYPE:int = 35;
		private var _recordArr:Array;
		/**
		 *BASE_STATE 基本状态 
		 * SELECT_STATE
		 */		
		private const BASE_STATE:int=1;
		private const SELECT_STATE:int=2;
		
		private var mc:MovieClip;
		
		private const MAX_ITEM_NUM:int=17*3;
		/****/
		private  var _type:int  = 1 ; 
		/****/
		private var _infoMC:MovieClip; 
		/****/
		private var _Money:uint ; 
		public function MysterySellLogic()
		{
		}
		public static function getInstance():MysterySellLogic
		{
			if(_self == null)
			{
				_self = new MysterySellLogic();
			}
			return _self;
		}
		public function  Init():void
		{
			_ui	= MysterySellUI.getInstance();
			_model = ModelLocator.getInstance();
			_bindManage=BindManage.getInstance();
			_strArr =new Vector.<strInfo>();
			_time=new Timer(1000);
			_date		=	new Date();
			_date.time 	=	0;
			//获取购买信息
			_model.addEventListener(String(CustomToClientFlag.SERVER_CUSTOMMSG_SEND_PUB_RECORD_INFO),getStrInfo);
			//刷新CD
			_model.addEventListener(String(CustomToClientFlag.SERVER_CUSTOMMSG_MYSTERY_NPC_GET_TIME),getUpdateTime);
			_grouplenth=_ui.itemgroup.row*_ui.itemgroup.col;
			initGroup();
			_ui.bugInfo.autoScroll=true;
		}
		public function set SellType(val:int):void
		{
			_type = val ; 
		}
		public function get SellType():int 
		{
			return _type
		}
		public function	BeforeShow():void
		{
			if(!SceneManager._itemIconLoad)
			{
				_model.addEventListener(LogicEvent.ITEMICONLOADED,loaded);
				function loaded():void
				{
					_ItemBack	= -1;
					_blindFlag	= -1;	
					BeforeShow();
					_model.removeEventListener(LogicEvent.ITEMICONLOADED,loaded)
				}
			}
//			//取到本地
//			_recordArr = new Array();
//			var _record:Record = _model.scene.GetRecordEx("VIPCountRec");
//			var _arr:Array = _record.recArr;
//			for(var i:String in _arr){
//				if(_arr[i][0] == MYSTERSELL_TYPE){
//					_recordArr.push(_arr[i][0], _arr[i][1]);
//				}
//			}
			
			SystemSender.getInstance().CustomMsg(CustomToServerFlag.CLIENT_CUSTOMMSG_MYSTERY_NPC_GET_TIME);
			if(_ItemBack!=-1)
			{
				unBind();
			}
			/***/
			if(_type==0)
			{
				_ui.windowBG.titleIcon="MysterySellUIPic";
				SystemSender.getInstance().CustomMsg(CustomToServerFlag.CLIENT_CUSTOMMSG_GET_PUB_RECORD_INFO,new WString("Pub_MysteryTrade"),"MysteryTradeLogRec0",0,30);
			}else if(_type==1)
			{
				_ui.windowBG.titleIcon="ForbiddenZone";
				SystemSender.getInstance().CustomMsg(CustomToServerFlag.CLIENT_CUSTOMMSG_GET_PUB_RECORD_INFO,new WString("Pub_MysteryTrade"),"MysteryTradeLogRec1",0,30);
				
			}
			
			bind();
			showBtn();
			addEvent();
		}
		public function	AfterHide():void
		{
			unBind()
			_ui.bugInfo.htmlText="";
			removeEvent();
			removeGroup();
			_type =1 ; 
			_recordArr = [];
		}
		private function bind():void
		{
			if(_ItemBack== -1)
			{
				_ItemBack   = _bindManage.BindRecord(_model.scene,"MysteryTradeRec"+_type,showSellItem,updateItem);
			}
		}
		private function unBind():void
		{
			if(_ItemBack != -1)
			{
				_ItemBack   = _bindManage.UnbindRecord("MysteryTradeRec"+_type,_ItemBack);
			}
			if(_blindFlag!=-1)
			{
				_blindFlag= _bindManage.UnbindRecord("FakeVipRec", _blindFlag);
			}
		}
		private function initGroup():void
		{
			for(var i:int=0;i<_grouplenth;i++)
			{
				_itemMC=_ui.itemgroup.getItemByIndex(i);
				(_itemMC["p_mc"] as MovieClip).gotoAndStop(BASE_STATE);
				_img= new NxClip();
				_img.x=_itemMC["img2"].x;
				_img.y=_itemMC["img2"].y;
				_itemMC["img"]=_img;
				_itemMC["txt"].text="";
				_itemMC["txt1"].text=""	;
				_itemMC["txt2"].text=""
				_itemMC["txt"].mouseEnabled=false;
				
				_txtCount   =	new NxLabel();
				_txtCount.glowColor =0x081f22;
				_txtCount.x = _itemMC["img2"].x;
				_txtCount.y = _itemMC["img2"].y;
				_itemMC["txtCount"] = _txtCount;
				
				_itemMC.addChild(_img);
				_itemMC.addChild(_txtCount);
			}
		}
		
		private function addEvent():void
		{
			if(_type==1)
			{
				_time       .addEventListener(TimerEvent.TIMER,onPlayTimer);
			}else
			{
				_time       .addEventListener(TimerEvent.TIMER,onPlayTimer);
				_ui.itemgroup.addItemsEvent(MouseEvent.CLICK,onClickGroup);
				_ui.itemgroup.addItemsEvent(MouseEvent.MOUSE_OUT,onOut)
				_ui.itemgroup.addItemsEvent(MouseEvent.MOUSE_OVER,onOver)
				_ui.windowBG.addEventListener(NxWindowEvent.WINDOW_CLOSE,onClose);
				_ui.btn.addEventListener(MouseEvent.CLICK,onClickBtn);
				_ui.btn.addEventListener(MouseEvent.MOUSE_OVER,onOverBtn);
				_ui.btn.addEventListener(MouseEvent.MOUSE_OUT,onOutBtn);
				_ui.bugInfo.addLinkClickHandel(onClickText);
			}
			
		}
		public function removeEvent():void
		{
			if(_type==1)
			{
				_time       .removeEventListener(TimerEvent.TIMER,onPlayTimer);
			}else
			{
				_time       .removeEventListener(TimerEvent.TIMER,onPlayTimer);
				_ui.itemgroup.removeItemsEvent(MouseEvent.CLICK,onClickGroup);
				_ui.itemgroup.removeItemsEvent(MouseEvent.MOUSE_OUT,onOut)
				_ui.itemgroup.removeItemsEvent(MouseEvent.MOUSE_OVER,onOver)
				_ui.windowBG.removeEventListener(NxWindowEvent.WINDOW_CLOSE,onClose);
				_ui.btn.removeEventListener(MouseEvent.CLICK,onClickBtn);
				_ui.btn.removeEventListener(MouseEvent.MOUSE_OVER,onOverBtn);
				_ui.btn.removeEventListener(MouseEvent.MOUSE_OUT,onOutBtn);
				_ui.bugInfo.removeLinkClickHandel();
				
				_ui.bugInfo.removeEventListener(MouseEvent.MOUSE_OUT,onHideTpis);
			}
			
		}
		private function showSellItem(PropertiesName:String,val:*,data:*):void
		{
			var configID:int=val[0]; //物品ID
			var amout:int=val[1];    //数量
				_Money = val[2]			//类型
			var value:int=val[3] //价格
			
			
			var obj:Object=StaticIni.getIniObj(configID.toString());
			var name:String=StaticIni.getSwfLangStr(configID.toString());
			var item:commodity=new commodity(configID.toString(),amout,value);
			updateCommodity(int(PropertiesName),item);
		
		}
		/**
		 *获取神秘商店商品出售价格 
		 * @return 
		 * 
		 */		
		private function getItemPrice(configID:int):int
		{
			var obj:Object=StaticIni.getIniObj("Item_"+configID);
			if(obj==null)
			{
				return 0;
			}
			return obj["BuyValue"];
		}
		private function updateItem(PropertiesName:String,val:*,data:*):void
		{
			
		}
		/**
		 *获取商店刷新时间 
		 * @param e
		 * 
		 */		
		private function getUpdateTime(e:CustomMsgEvent):void
		{
			_date.time=e.pList[0]*1000;
//			trace("神秘商店收到更新时间消息时间是："+e.pList[0])
//			_type == e.pList[1];
//			_ui.windowBG.titleIcon=_type==1?"":"";
			_time.start();
		}
		/**
		 *获取所有玩家购买的信息 
		 * @param e
		 * 
		 */		
		private function getStrInfo(e:CustomMsgEvent=null):void
		{
			_strArr=new Vector.<strInfo>();
			var arr:Array=e.pList;
			
			if(arr.length>MAX_ITEM_NUM)
			{
				var len:int =arr.length-MAX_ITEM_NUM;
				arr.splice(MAX_ITEM_NUM,len);
			}
			savStrInfo(arr);

			
		}
		/**
		 *保存购买信息数据 
		 * @param arr
		 * 
		 */		
		private function savStrInfo(arr:Array):void
		{
			for(var i:int=0;i<arr.length;i+=3)
			{
				_strArr.push(new strInfo(arr[i],arr[i+1],arr[i+2]));
			}
			setStrInfo();
		}
		/**
		 *更新显示购买信息数据 
		 * 
		 */		
		private function setStrInfo():void
		{
			var arr:Array=[];
			_ui.bugInfo.htmlText="";
			for(var i:String in _strArr)
			{
				arr=setStr(_strArr[int(i)]);
				var str:String	=	"<a href=\"event:" 
					+  _strArr[int(i)].name + "," +"\">"
					+  arr[0] + "</a>"
					+arr[1]
					+"<a href=\"event:item_"+"," 
					+_strArr[int(i)].configID +"\">"
					+ link_color(arr[2],arr[3])
					+"</a>";
				_ui.bugInfo.htmlText+=str;
			}
		}
		/**
		 *获取字符串数据 
		 * @param strVo
		 * @return 0 前缀 1物品名字 2物品颜色 3 购买的数量
		 * 
		 */		
		private function setStr(strVo:strInfo):Array
		{
			var str:String="";
			var itemObj:Object=StaticIni.getIniObj(strVo.configID);
			var titalStr:String=StaticIni.getSwfLangStrVar("UIString_1000333",[strVo.name]);
			var name:String=StaticIni.getSwfLangStr(itemObj["NameID"]);
			var midst:String=StaticIni.getSwfLangStr("UIString_1000334"); //购买了
			return [titalStr,midst,name,int(itemObj["Color"])] ;
		}
		/**
		 *点击文本超链接 
		 * @param val
		 * 
		 */		
		private function onClickText(val:String):void
		{
			if( val.indexOf("item_") != -1 )
			{
				//点击的是装备,道具的时候
				onShowItem(val);
				return;
			}
			var eplist:Array=val.split(",");
			if(_model.scene.Role.getPlayerName() ==eplist[0]) return;
			MenuListManager.clickPlayer(eplist[0]);
		}
		/**
		 * 	显示道具tips
		 */
		private function onShowItem(tips : String):void
		{
			TipsMainLogic.instance.hide();
			var tipsList : Array = tips.split(",");
			var configID : int = tipsList[1];
			var tObj:Object=TipsMainLogic.instance.getStaticObjWithID(configID+"")//StaticIni.getIniObj(configID.toString());
			TipsMainLogic.instance.showMain( tObj );
			_ui.bugInfo.addEventListener(MouseEvent.MOUSE_OUT,onHideTpis);
			
		}
		private function onHideTpis(e:MouseEvent):void
		{
			TipsMainLogic.instance.hide();
		}
		private function showBtn():void
		{
			var vipLv:int = _model.scene.Role.getVipLevel();
			var obj:Object = StaticIni.getIniObj("MysteryNPC_VIP");
			if(obj == null)
			{
				//				trace("没有找到配置文件");
				return;
			}
			var needLv:int = int(obj["NeedVIPLv"]);
//			if(vipLv>=needLv)
//			{
//				_ui.btn.visible=true;
//			}
//			else
			{
				//绑定表格
				if(_blindFlag==-1)
				{
					_ui.btn.visible = false;
					_blindFlag= _bindManage.BindRecord(_model.scene,"VIPCountRec",onaddPerHandle,onremovePerHandle);
				}
//				if(_recordArr.length >0 && _recordArr[1] > 0){
//					_ui.btn.visible = true;
//				} else {
//					_ui.btn.visible = false;
//				}
			}
		}
		
		private function onaddPerHandle(PropertiesName:String,PropertiesValue:Array,data:*):void
		{
			if(PropertiesValue[0] == MYSTERSELL_TYPE)
			{
//				_recordArr[1] = PropertiesValue[0];
				if(PropertiesValue[2]+PropertiesValue[3] >PropertiesValue[1])
				{
					_ui.btn.visible = true;
				} 
				else 
				{
					_ui.btn.visible = false;
				}
			}
		}
		
		private function onremovePerHandle(PropertiesName:String,PropertiesValue:Array,data:*):void
		{
			
		}
		/**
		 *打开商店的接口 默认为（神秘商店） 
		 * @param type  1 禁地商店 0神秘商店
		 * 
		 */		
		public function openMysterySellLogic(type:int=0):void
		{
			SellType = type
			SystemSender.getInstance().CustomMsg(CustomToServerFlag.CLIENT_CUSTOMMSG_REQUEST_OPEN_UI,98 ,type);
		}
		/**
		 *显示一个物品 
		 * @param index  格子索引
		 * @param ver    存放商品的数组
		 * 
		 */		
		private function updateCommodity(index:int,ver:commodity):void
		{
			if(_type==0)
			{
				_itemMC=_ui.itemgroup.getItemByIndex(index);
			}else if (_type==1)
			{
				_itemMC=ForbiddenZoneLogic.getInstance()._ui.sellgroup.getItemByIndex(index);
			}
			
			_itemMC["PropertiesName"] = index;
			if(ver.amout == 0)
			{
				_itemMC["btn"].enabled=false;
				_itemMC["btn"].mouseEnabled=false;
				_itemMC["txt"].htmlText =StaticIni.getSwfLangStr("UIString_1000343");
				(_itemMC["btn"] as SimpleButton).filters=[FilterUtil.GrayColorFilter];
			}
			else
			{
				_itemMC["btn"].enabled=true;
				_itemMC["btn"].mouseEnabled=true;
				_itemMC["txt"].htmlText =StaticIni.getSwfLangStr("UIString_1000342");
				(_itemMC["btn"] as SimpleButton).filters=null;
			}
			(_itemMC["img"] as NxClip).mouseChildren=true;	
			var itemObj:Object=StaticIni.getIniObj(ver.configid);
			if(itemObj==null)return;
			(_itemMC["img"] as NxClip).source= ResManager.newResClass(ResourcesPath.getPropsURL(int(itemObj["Photo"])));
//			_itemMC["txtCount"].text=ver.amout;
			_itemMC["txt1"].htmlText =link_color(StaticIni.getSwfLangStr(itemObj["NameID"])+"x"+ver.amout,int(itemObj["Color"]));
			
			_itemMC["txt2"].htmlText =StaticIni.getSwfLangStrVar("UIString_1000344",[ver.value])+StaticIni.getSwfLangStr("CapitalType_"+_Money) ; 
//			_itemMC["txt2"].htmlText =StaticIni.getSwfLangStrVar("UIString_1000344",[ver.value])+StaticIni.getSwfLangStr("UIString_1000240");//setShowGoldStr(int(BuyType),int(BuyCapitalType));
			itemObj["amout"]=ver.amout;
			itemObj["price"]=ver.value;
			_itemMC["date"]=itemObj;
			
		}
		private function removeGroup():void
		{
			for(var i:int=0;i<_grouplenth;i++)
			{
				_itemMC=_ui.itemgroup.getItemByIndex(i);
				(_itemMC["img"] as NxClip).source="";
				_itemMC["txtCount"].text="";
				_itemMC["txt1"].text ="";
				_itemMC["txt2"].text ="";
				_itemMC["date"]=null;
			}
		}
		private function setShowGoldStr(type:int,kind:int):String
		{
			var strID:String;
			if(type == 1) //钱
			{
				switch(kind)
				{
					case 0: //阅历 
						strID ="UIString_1000241"
						break;
					case 1: //铜钱
						strID ="UIString_1000240"
						break;
					case 2: //元宝
						strID ="UIString_1000244"
						
						break;
					case 3:  //修为
						strID ="UIString_1000243"
						break;
					case 4:  //江湖声望
						strID ="UIString_1000242"
						break;
				}
			}
			else if(type == 2) //玉牌
			{
				switch(kind)
				{
					case 0:
						strID ="未定义类型"
					case 1:   //白
						strID ="UIString_1000245"
						break;
					case 2:   //绿
						strID ="UIString_1000246"
						break;
					case 3: //蓝
						strID ="UIString_1000247"
						break;
					case 4:   //紫
						strID ="UIString_1000248"
						break;
					case 5:  //黄
						strID ="UIString_1000249"
						break;
				}
			}
			return StaticIni.getSwfLangStr(strID);
		}
		private function onPlayTimer(e:TimerEvent):void
		{
			if(_date.time>=1000)
			{
				_date.time-=1000;
				var str:String=getTimeStr(_date);
				_ui.timelabel.htmlText=str;
				/****/
				ForbiddenZoneLogic.getInstance().getTimeLabel = str
				if(_date.time <= 0)
				{
					_time.reset();
				}
				
			}
			else
			{
				_time.reset();
				ForbiddenZoneLogic.getInstance().getTimeLabel = "00:00:00";
				_ui.timelabel.htmlText="00:00:00";
			}
			
			
		}
		/**
		 * 转换时间 
		 * @param _date
		 * @return 
		 * 
		 */		
		public function getTimeStr(_date:Date):String
		{
			var hours  :int  = _date.hoursUTC;
			var minutes:int  = _date.minutesUTC;
			var seconds:int  = _date.secondsUTC;
			var str:String;
			str = initTime(hours)+":"+initTime(minutes)+":"+initTime(seconds);
			return str;	
		}
		/**
		 * 格式时间 
		 * @param val
		 * @return 
		 * 
		 */		
		private function initTime(val:int):String
		{
			var  va:String = val.toString();
			val>9?va:va="0"+va;
			return va;
		}
		protected function link_color(str:String,color:int):String
		{
			if(color < 1 || color >8)
			{
				color	=	1;
			}
			return ("<font color ='"+COLOR_TABLE[color]+str+"</font>");
		}
		private function onClickGroup(e:MouseEvent):void
		{
			
			_infoMC=e.currentTarget as MovieClip;
			
			var itemObj:Object=_infoMC["date"];
			if(itemObj==null)return;
			var name:String=StaticIni.getSwfLangStr(itemObj["NameID"]);
			var amout:int =int(itemObj["amout"])
			if(e.target == _infoMC["btn"])
			{
//				if(_type==0)
//				{
//					SystemSender.getInstance().CustomMsg(
//						CustomToServerFlag.CLIENT_CUSTOMMSG_TRADE_WITHNPC,0,View.VIEWPORT_TOOL,int(itemObj["NameID"]),-1,amout);
					
//				}else if(_type==1)
//				{
					SystemSender.getInstance().CustomMsg(
						CustomToServerFlag.CLIENT_CUSTOMMSG_BUY_MYSTERY_ITEM,int(_type),_infoMC["PropertiesName"]);
//					SitAlerLogic.getIntatic().setUIinfo("你确定要购买此道具" , [] ,clickSure, _infoMC["btn"])
//				}
			
//				AlertUI.showAlert(StaticIni.getSwfLangStr("SellUI_Buy"),StaticIni.getSwfLangStrVar("UIString_1000338",[name,amout]),AlertUI.YES|AlertUI.NO,clickBackFunc,[itemObj["NameID"],amout]);
			}
		}
		private function clickSure():void
		{
			SystemSender.getInstance().CustomMsg(
				CustomToServerFlag.CLIENT_CUSTOMMSG_BUY_MYSTERY_ITEM,"MysteryTradeLogRec"+_type,_infoMC["PropertiesName"]);
		}
		private function clickBackFunc(targetName:int,inputTxt:String,data:Array):void
		{
			if(targetName == AlertUI.YES)
			{
				SystemSender.getInstance().CustomMsg(
					CustomToServerFlag.CLIENT_CUSTOMMSG_TRADE_WITHNPC,0,View.VIEWPORT_TOOL,data[0],-1,data[1]);
			}
		}
		public function onOut(e:MouseEvent):void
		{
			TipsMainLogic.instance.hide();
			if(mc == null)return;
			(mc as MovieClip).gotoAndStop(BASE_STATE);
		}
		public function onOver(e:MouseEvent):void
		{
			var MC:MovieClip=e.currentTarget as MovieClip;
			if(MC==null)return;
			if(e.target == MC["img"])
			{
				if(mc==null)
				{
					(MC as MovieClip).gotoAndStop(SELECT_STATE);
					
				}
				else 
				{
					(mc as MovieClip).gotoAndStop(BASE_STATE);
					(MC as MovieClip).gotoAndStop(SELECT_STATE);
				}
				mc=MC;
				if(MC["date"]==null) return;
				var obj:Object=TipsMainLogic.instance.getStaticObjWithID(MC["date"]["NameID"]);
				obj["SellValue"]=obj["price"];
				if(_type==1)
				{
					obj["_type"]= 1 ;
					// 0 铜钱 4元宝
					obj["_kind"]= _Money; 
				}
				TipsMainLogic.instance.showMain(obj);
			}
		}
		private function onOverBtn(e:MouseEvent):void
		{
			var obj:Object = StaticIni.getIniObj("MysteryNPC_VIP");
			if(obj==null)return;
			var num:String=obj["lv4"];
			var str:String=StaticIni.getSwfLangStrVar("UIString_1000339",[num]);
			TipsMainLogic.instance.showString(str);
		}
		private function onOutBtn(e:MouseEvent):void
		{
			TipsMainLogic.instance.hide();
		}
		private function onClose(e:NxWindowEvent):void
		{
			_ui.hide();
		}
		/**
		 *刷新宝物 
		 * @param e
		 * 
		 */		
		private function onClickBtn(e:MouseEvent):void
		{
			var gold:String = StaticIni.getIniVar("MysteryNPC_VIP","lv4");
			SitAlerLogic.getIntatic().setUIinfo("UIString_1000339",[gold],blackfun,_ui.btn);
		}
		private function blackfun():void
		{
			SystemSender.getInstance().CustomMsg(CustomToServerFlag.CLIENT_CUSTOMMSG_AFFIRM_CHARGE,17);
		}
	}
}
class commodity
{
	public var configid:String;
	public var amout:int //数量   如果 为0 售光
	public var value:int;  //价钱
	public function commodity(configid:String,amout:int,value:int):void
	{
		this.configid=configid;
		this.amout=amout;
		this.value=value;
	}
	
}
class strInfo
{
	public var name:String;   //玩家名字
	public var configID:String; //物品ID
	public var amout:int;    //数量
	public function strInfo(name:String,configID:String,amout:int):void
	{
		this.name=name;
		this.configID=configID;
		this.amout=amout;
	}
}